<template>  
<div class="leftnav">	
	<div class="layui-side-scroll">	
	    <div class="layui-logo">
		    <span class="layui-logo-img"><img src="../../../static/layui/images/image/icon_logo.png"/></span>
		    <span>后台管理</span>    
	    </div> 
	    <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
		    <li data-name="home" class="layui-nav-item layui-nav-itemed">
		        <a href="javascript:;" lay-direction="2" :data="20000">
			        <i class="layui-icon layui-icon-app"></i>
			        <cite>房态</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <!--<dl class="layui-nav-child">
		    		<dd data-name="fangtai" class="layui-this secondary">
		    			<router-link  @click.native="updateData()" to='/index'>房态图</router-link>
		    			<router-link  @click.native="updateData()" to='/statistics'>房态统计</router-link>
		    			<router-link  @click.native="updateData()" to='/forecast'>房态预测</router-link>
		    		</dd>
		    	</dl>-->
		    </li>
		    <li data-name="reserve" class="layui-nav-item">
		        <router-link  @click.native="updateData()" to='/reservelist'>
			        <i class="layui-icon layui-icon-component"></i>
			        <cite>预定</cite>
			        <span class="layui-nav-more"></span>
		        </router-link>		       
		    </li>
		    <li data-name="house" class="layui-nav-item">
		        <router-link  @click.native="updateData()" to='/houseorder'>
			        <i class="layui-icon layui-icon-form"></i>
			        <cite>房单 </cite>
			        <span class="layui-nav-more"></span>
		        </router-link>			        
		    </li>
		    <li data-name="team" class="layui-nav-item">
		        <router-link  @click.native="updateData()" to='/teamlist'>
			        <i class="layui-icon layui-icon-user"></i>
			        <cite>团队</cite>
			        <span class="layui-nav-more"></span>
		        </router-link>		        
		    </li>
		    <li data-name="butlers" class="layui-nav-item">
		        <a href="javascript:;" lay-direction="2">
			        <i class="layui-icon layui-icon-util"></i>
			        <cite>管家</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <dl class="layui-nav-child">
		    		<dd data-name="guanjia" class="layui-this secondary">
		    			<router-link  @click.native="updateData()" to='/repairlist'>维修房管理</router-link>	
		    			<router-link  @click.native="updateData()" to='/roomcleanlist'>清洁房管理</router-link>	
		    			<router-link  @click.native="updateData()" to='/roomManagelist'>房间管理记录</router-link>	
		    		</dd>
		    	</dl>
		    </li>
		    <li data-name="member" class="layui-nav-item">
		        <a href="javascript:;" lay-direction="2">
			        <i class="layui-icon layui-icon-diamond"></i>
			        <cite>会员</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <dl class="layui-nav-child">
		    		<dd data-name="huiyuan" class="layui-this secondary">
		    			<router-link  @click.native="updateData()" to='/memberlist'>会员列表</router-link>
		    			<router-link  @click.native="updateData()" to='/membercardlist'>会员卡设置</router-link>		    			
		    			<router-link  @click.native="updateData()" to='/memberbuylist'>会员购买记录</router-link>
		    			<router-link  @click.native="updateData()" to='/memberabonusSet'>会员分润设置</router-link>
		    		</dd>
		    	</dl>
		    </li>
		    <li data-name="report" class="layui-nav-item">
		        <a href="javascript:;" lay-direction="2">
			        <i class="layui-icon layui-icon-table"></i>
			        <cite>报表</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <dl class="layui-nav-child">
		    		<dd data-name="baobiao" class="layui-this secondary">
		    		    <!--<router-link  @click.native="updateData()" to='/reports?from=1'>交接报表1</router-link>暂时屏蔽-->
		    			<router-link  @click.native="updateData()" to='/reports?from=2'>营业报表</router-link>
		    			<router-link  @click.native="updateData()" to='/reports?from=3'>商家报表</router-link>
		    			<router-link  @click.native="updateData()" to='/reports?from=4'>员工报表</router-link>
		    			<router-link  @click.native="updateData()" to='/bookreport'>营业统计汇总报表</router-link>
		    		</dd>
		    	</dl>
		    </li>
		    <li data-name="staff" class="layui-nav-item">
		        <a href="javascript:;" lay-direction="2">
			        <i class="layui-icon layui-icon-group"></i>
			        <cite>员工管理</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <dl class="layui-nav-child">
		    		<dd data-name="yuangongGL" class="layui-this secondary">
		    			<router-link  @click.native="updateData()" to='/workerlist'>员工信息</router-link>
		    			<router-link  @click.native="updateData()" to='/postlist'>职位信息</router-link>	
		    			<router-link  @click.native="updateData()" to='/shiftslist'>班次信息</router-link>
		    			<router-link  @click.native="updateData()" to='/workmenlist'>上班人员安排</router-link>
		    		</dd>
		    	</dl>
		    </li>
		    <li data-name="audit" class="layui-nav-item">
		    	<a href="javascript:;" lay-direction="2">
			        <i class="layui-icon layui-icon-templeate-1"></i>
			        <cite>夜审</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <dl class="layui-nav-child">
		    		<dd data-name="yeshen" class="layui-this secondary">		    			
		    			<router-link  @click.native="updateData()" to='/auditlist'>夜审统计</router-link>
		    			<router-link  @click.native="updateData()" to='/auditRecord'>夜审记录</router-link>		    			
		    			<router-link  @click.native="updateData()" to='/auditSet'>夜审设置</router-link>		    			
		    		</dd>
		    	</dl>
		    </li>
		    <li data-name="system" class="layui-nav-item">
		        <a href="javascript:;" lay-direction="2">
			        <i class="layui-icon layui-icon-set-sm"></i>
			        <cite>管理模块</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <dl class="layui-nav-child">
		    		<dd data-name="guanliMK" class="layui-this secondary">
		    			<router-link  @click.native="updateData()" to='/roomtypelist'>房型管理</router-link>
		    			<router-link  @click.native="updateData()" to='/roompricelist'>房价管理</router-link>	    			
		    			<router-link  @click.native="updateData()" to='/roomlist'>房间管理</router-link>
		    			<router-link  @click.native="updateData()" to='/servicelist'>酒店服务设施</router-link>
		    			<router-link  @click.native="updateData()" to='/policylist'>酒店政策设置</router-link>		    			
		    			<router-link  @click.native="updateData()" to='/lclist'>楼层管理</router-link> 
		    			<router-link  @click.native="updateData()" to='/agreementlist'>协议折扣设置</router-link> 
		    			<router-link  @click.native="updateData()" to='/intermediarylist'>中介折扣设置</router-link> 
		    			<router-link  @click.native="updateData()" to='/memberDiscountlist'>会员折扣设置</router-link> 
		    			<router-link  @click.native="updateData()" to='/housetimeTypelist'>住房时间类型</router-link>
		    			<router-link  @click.native="updateData()" to='/storelist'>门店管理</router-link>
		    		</dd>
		    	</dl>
		    </li>
		    <li data-name="operate" class="layui-nav-item">
		        <a href="javascript:;" lay-direction="2">
			        <i class="layui-icon layui-icon-log"></i>
			        <cite>操作管理</cite>
			        <span class="layui-nav-more"></span>
		        </a>
		        <dl class="layui-nav-child">
		    		<dd data-name="caozuoGL" class="layui-this secondary">		    			
		    			<router-link  @click.native="updateData()" to='/recordlist'>操作日志</router-link>
		    			<router-link  @click.native="updateData()" to='/changeroomlist'>换房记录</router-link>		    			
		    			<router-link  @click.native="updateData()" to='/continuedlive'>续住记录</router-link>
		    			<router-link  @click.native="updateData()" to='/blanking'>冲减申请记录</router-link>
		    		</dd>
		    	</dl>
		    </li>		    
	    </ul>
	</div>  
	
</div> 

</template>
<script>
	export default {
	  name:'leftnav',
	  data () {
	    return { 
	    	
	    }
	  },
	  mounted(){
	  	var firstNav=localStorage.getItem('firstNav');
	  	if(firstNav){
	  		$(".layui-nav-item[data-name="+firstNav+"]").addClass("layui-nav-itemed").siblings().removeClass("layui-nav-itemed");
	  		setTimeout(function(){
	  			firstNav=localStorage.getItem('firstNav');
	  			$(".layui-nav-item[data-name="+firstNav+"]").addClass("layui-nav-itemed").siblings().removeClass("layui-nav-itemed");
	  		},1000)
	  			
	  	}
	  	$(".layui-nav-item").on("click",function(){
	  		var firstNav=$(this).attr('data-name');
	  		localStorage.setItem('firstNav',firstNav);
			$(this).addClass("layui-nav-itemed").siblings().removeClass("layui-nav-itemed");	
			
		})
	  	this.checkTip();
	  },
	  methods: {
	  	updateData:function(){
	  		this.$router.go(0)
	  	},
		 getreports:function(is){
		 	alert(is)
		 },
		 checkTip:function(){
		 	var url = '/hotelreservation/bapi/v1.9/room-books/departure/getSecond';
			ajaxRequest(url,'GET','json','',function(ret,err){
				var time=ret.data;
				setTimeout(function(){
					layer.open({
				      type: 2
				      ,title: '今日退房'
				      ,content: baseurl+'/checkTip'
				      ,area: ['500px', '350px']
			      });
				},time*1000)
			})
		 }
	  } 
	}
	
</script>
<style scoped>
</style>
